package com.inkrl.book.controller;

import com.inkrl.book.service.BookService;
import com.jt.common.pojo.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class BookController {
    @Autowired
    private BookService bookService;
    //查询所有书本
    @GetMapping("/book")
    public List<Book> queryBook(){
        return bookService.queryBook();
    }
    //根据书本编号查询书本
    @GetMapping("/book/id")
    public Book queryBookByIsbn(String isbn){
        return bookService.queryOneByIsbn(isbn);
    }
}
